import React, { Component } from 'react'
import './product.scss'
import PropTypes from 'prop-types'

export default class Product extends Component {
  static defaultProps={
    image:'https://img14.360buyimg.com/pop/jfs/t1/174609/18/38571/30241/65321feaF0cca8d35/e3fab094c9b8eeec.jpg',
    sales:0
  }
  static propTypes={
    store_name:PropTypes.string.isRequired,
    price:PropTypes.number,
    sex:PropTypes.oneOf(['男','女'])
  }
  render() {
    return (
      <div className='box'>
         <div className='imgbox'>
            <img src={this.props.image} className='img' />
         </div>
         <div className='title'>{this.props.store_name}</div>
         <div className='pricebox'>
            <div className='yhj'>优惠价</div>
            <div className='price-2'>￥{this.props.price}</div>
            <div className='price-1'>￥{this.props.ot_price}</div>
         </div>
         <div className='sales'>已抢购{this.props.sales}件</div>
         <div>性别:{this.props.sex}</div>
      </div>
    )
  }
}
/*
Product.defaultProps={
  image:'https://img14.360buyimg.com/pop/jfs/t1/174609/18/38571/30241/65321feaF0cca8d35/e3fab094c9b8eeec.jpg',
  sales:0
}
*/

